package com.zyk.scaffold.seata.biz.business.buy.controller;

import com.zyk.scaffold.core.domain.Result;
import com.zyk.scaffold.seata.biz.business.buy.pojo.request.BuyRequest;
import com.zyk.scaffold.seata.biz.business.buy.service.BuyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/buy")
public class BuyController {

    @Autowired
    private BuyService buyService;

    @PostMapping("/ok")
    public Result<Boolean> ok(@RequestBody BuyRequest buyRequest){
        return Result.ok(buyService.ok(buyRequest));
    }

    @PostMapping("/biz_error")
    public Result<Boolean> biz_error(@RequestBody BuyRequest buyRequest){
        return Result.ok(buyService.biz_error(buyRequest));
    }

    @PostMapping("/order_error")
    public Result<Boolean> order_error(@RequestBody BuyRequest buyRequest){
        return Result.ok(buyService.order_error(buyRequest));
    }

    @PostMapping("/stock_error")
    public Result<Boolean> stock_error(@RequestBody BuyRequest buyRequest){
        return Result.ok(buyService.stock_error(buyRequest));
    }

    @PostMapping("/none_seata_biz_error")
    public Result<Boolean> none_seata_biz_error(@RequestBody BuyRequest buyRequest){
        return Result.ok(buyService.none_seata_biz_error(buyRequest));
    }

    @PostMapping("/none_seata_order_error")
    public Result<Boolean> none_seata_order_error(@RequestBody BuyRequest buyRequest){
        return Result.ok(buyService.none_seata_order_error(buyRequest));
    }

    @PostMapping("/none_seata_stock_error")
    public Result<Boolean> none_seata_stock_error(@RequestBody BuyRequest buyRequest){
        return Result.ok(buyService.none_seata_stock_error(buyRequest));
    }

}
